package com.binhthuan.catechist.server;

import com.binhthuan.catechist.server.util.JsonConverter;
import com.google.gson.annotations.Expose;

public class ResponseObject {

    @Expose
    private QueryObject response;

    public ResponseObject(Object data) {
        response = new QueryObject(data);
    }

    public ResponseObject(QueryObject queryObject) {
        response = queryObject;
    }

    public ResponseObject(Integer status) {
        response = new QueryObject(status, 0, 0, 0, null);
    }

    public ResponseObject(Integer status, Integer startRow, Integer endRow, Integer totalRows, Object data) {
        response = new QueryObject(status, startRow, endRow, totalRows, data);
    }

    public QueryObject getResponse() {
        return response;
    }

    public void setResponse(QueryObject response) {
        this.response = response;
    }

    public String toJson() {
        return JsonConverter.getInstance().toJson(this);
    }
}
